ifndef equivalent

Is there an ifndef equivalent in DOORS that allows for conditional importing of .inc files?

Thanks
Patrick
PatrickGuay - Tue Jan 08 13:46:54 EST 2013

Re: ifndef equivalent
Mathias Mamsch - Fri Jan 11 05:19:10 EST 2013

No. That does not mean, that you cannot use a preprocessor on your DXL files, but you cannot do this at runtime, since DXL files are executed in a two pass way. Once the execution starts all Include files are read and translated before the instructions are executed. So you can only use 'eval' to dynamically execute code in DOORS, however you need to be careful when using it.

IFNDEF is a solution, what is the problem? I.E. what are you trying to solve using ifndef?

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: ifndef equivalent
PatrickGuay - Fri Jan 11 07:49:28 EST 2013

We are dealing with a latency problem that is slowing down our layouts in a significant way. Changing from object to object takes approx 20 seconds.

I noticed that we are including a library inc file which in turn calls imports all the remaining libraries we have created (between 20-30 libraries). We have never had a latency problem on our traceability layouts before. When I remove the include files and simply paste the needed methods in my layout and re-apply it to the view the problem is solved and the DOORS module behaves as usual (Quick to change objects).

I was just looking for a way to debug the layout in order to eliminate possible errors.

Patrick

Re: ifndef equivalent
Mathias Mamsch - Fri Jan 11 12:18:09 EST 2013

PatrickGuay - Fri Jan 11 07:49:28 EST 2013
We are dealing with a latency problem that is slowing down our layouts in a significant way. Changing from object to object takes approx 20 seconds.

I noticed that we are including a library inc file which in turn calls imports all the remaining libraries we have created (between 20-30 libraries). We have never had a latency problem on our traceability layouts before. When I remove the include files and simply paste the needed methods in my layout and re-apply it to the view the problem is solved and the DOORS module behaves as usual (Quick to change objects).

I was just looking for a way to debug the layout in order to eliminate possible errors.

Patrick

Latency problems in layout dxl can have a lot of reasons, the most common I can think of:
  • layouts triggering each other constantly (don't do that)
  • layouts opening and closing modules continuously (don't do that)
  • layouts performing inefficient or every costly operations (use attribute DXL and be efficient)
  • layouts using eval_ that includes from network (don't do that)

There are probably lots of others and I do not see how ifndef would help you with that. Did you maybe use eval in your layout DXL? The problem with eval is, that each time the code is executed it is parsed, translated by the DXL interpreter. This is a costly operation, therefore eval_ in layout DXL should only be used with very simple code that is quick to parse. In no circumstance an include from a network resource should be in there.

If that is not your problem I guess you need to profile your code to measure execution times and counts.

Maybe that helps, regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS